{% extends "base.html" %}
{% block header %}普通用户管理{% endblock %}
{% block content %}
<div class="card shadow-sm rounded p-4 mb-4">
    <h4 class="mb-3">普通用户列表</h4>
    <div class="table-responsive">
        <table class="table table-bordered align-middle">
            <thead class="table-light">
                <tr>
                    <th>用户名</th>
                    <th>姓名</th>
                    <th>邮箱</th>
                    <th>是否启用</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                {% for user in users %}
                <tr>
                    <td>{{ user.username }}</td>
                    <td>{% if user.profile %}{{ user.profile.realname }}{% endif %}</td>
                    <td>{{ user.email }}</td>
                    <td>{{ user.is_active|yesno:"启用,禁用" }}</td>
                    <td>
                        <a href="/normal_user/edit/{{ user.id }}/" class="btn btn-sm btn-primary">编辑</a>
                    </td>
                </tr>
                {% empty %}
                <tr><td colspan="5" class="text-center">暂无普通用户信息</td></tr>
                {% endfor %}
            </tbody>
        </table>
    </div>
</div>
{% endblock %}
